package com.woniu.exception.controller;

import com.woniu.bean.R;
import com.woniu.exception.bean.TLiableside;
import com.woniu.exception.service.ITLiablesideService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yellowDocter
 * @since 2022-08-15
 */
@RestController
@RequestMapping("/tLiableside")
public class TLiablesideController {


    @Autowired
    private ITLiablesideService liablesideService;

    @CrossOrigin
    @GetMapping("all")
    @ApiOperation("house查询所有的数据")
    public R listHouse() {

        List<TLiableside> list = liablesideService.list();

        R ok = R.OK();
        ok.setData(list);
        return ok;
    }


    @CrossOrigin
    @GetMapping("/{liablesideId}")
    public TLiableside selectById(@PathVariable Integer liablesideId) {

        TLiableside liableside = liablesideService.getById(liablesideId);

        return liableside;
    }
}
